You type:
*Italic*, **bold** super^script^ and a [link](www.gov.uk).
You get:
Italic, bold, superscript and a link.
14 May 2018
This talk is for beginners.
It isn't about how to code.
It's about improving what we do.
The Excel-Word approach is looooong and error-prone. Exaggerated example:
Questions to ask yourself:
We can reduce error and go faster with R.
A document with filetype .Rmd in which you:
*, [], ^, etc)
Enclosed in three hyphens. Specify metadata and what output should be produced. There's also space for some style information. You type: You get: Italic, bold, superscript and a link. You can write some R code in the middle of a sentence! Wrap the code in backticks (the button under the Esc key) and start it with the letter You type: You get: The answer to 1 + 1 is 2 Let's say You type: You get: The best Pokemon is Lotad You type: Don't worry about the code, just know that it's going to produce something. You get: Here's an important plot of chick weights and feed types. DEMO TIME! Your R Markdown is rendered into 'plain' markdown by the package .Rmd ➡️ This isn't essential knowledge.What does it look like?
What does it look like?
Header
---
title: "Your title"
author: "Your name"
date: "The date"
output:
word_document:
reference_docx: mystyles.docx
highlight: "tango"
---
Body text: formatting
*Italic*, **bold** super^script^ and a [link](www.gov.uk).
Body text: inline code (maths)
r.The answer to 1 + 1 is `r 1 + 1`
Body text: inline code (stored values)
my_value <- "Lotad"The best Pokemon is `r my_value`
Code chunks: input
Here's an important plot of chick weights and feed types.
```{r chicks}
chickwts %>%
group_by(feed) %>%
ggplot() +
geom_col(aes(x = feed, y = weight))
```
Code chunks: output
Simple steps
To summarise
What's actually hapening?
knitr (hence why you 'knit' to render the document), then something called pandoc converts it from markdown to your output format.knitr ➡️ .md ➡️ pandoc ➡️ .html/.pdf/.docxFurther reading